import React from 'react';
import { Router, Route, Switch } from 'dva/router';
import ExamplePage from './routes/ExamplePage';
import IndexPage from './routes/IndexPage';
import MyPage from './routes/MyPage';
import RecentPage from './routes/Recent'
import Searching from './routes/Searching';
import Searchresult from './routes/Searchresult';
import ClassDetail from './routes/Classdetail';
import Classinfo from './routes/Classinfo';
import VideoPage from './routes/Videoplay';
import LoginPage from './routes/LoginPage';
import RegisterPage from './routes/RegisterPage';
import InfoPage from './routes/InfoPage';
import InfoEditPage from './routes/UserinfoEdit';
import CartPage from './routes/CartPage';
import ClassPage from './routes/ClassPage';
import Classsort from './routes/Classsort';
import PayPage from './routes/PayPage';
import RedirectPage from './routes/RedirectPage';
import PayResult from './routes/PayResult';
function RouterConfig({ history }) {
  return (
    <Router history={history}>
      <Switch>
        <Route path="/redirect" exact component={RedirectPage} />
        <Route path="/exampletry" exact component={ExamplePage} />
        <Route path="/searching" exact component={Searching} />
        <Route path="/searchresult" exact component={Searchresult} />
        <Route path="/classdetail" exact component={ClassDetail} />
        <Route path="/classsort" exact component={Classsort} />
        <Route path="/classinfo/:cid" component={Classinfo} />
        <Route path="/" exact component={IndexPage} />
        <Route path="/my" exact component = {MyPage} />
        <Route path="/my/info" exact component = {InfoPage} />
        <Route path="/my/infoedit" exact component = {InfoEditPage} />
        <Route path="/login" exact component = {LoginPage} />
        <Route path="/register" exact component = {RegisterPage} />
        <Route path="/class" exact component = {ClassPage} />
        <Route path="/recent" exact component = {RecentPage} />
        <Route path="/class/:cid/video/:vid" component = {VideoPage} />
        <Route path="/cart" exact component = {CartPage} />
        <Route path="/pay" exact component = {PayPage} />
        <Route path='/result/:id' exact component = {PayResult} />
      </Switch>
    </Router>
  );
}

export default RouterConfig;
